package com.imc.beans;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * FriendListId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class FriendListId implements java.io.Serializable {

	// Fields

	private Integer uid;
	private Integer friendId;
	private String groupName;
	private Integer friendDate;

	// Constructors

	/** default constructor */
	public FriendListId() {
	}

	/** minimal constructor */
	public FriendListId(Integer uid, Integer friendId) {
		this.uid = uid;
		this.friendId = friendId;
	}

	/** full constructor */
	public FriendListId(Integer uid, Integer friendId, String groupName,
			Integer friendDate) {
		this.uid = uid;
		this.friendId = friendId;
		this.groupName = groupName;
		this.friendDate = friendDate;
	}

	// Property accessors

	@Column(name = "uid", nullable = false)
	public Integer getUid() {
		return this.uid;
	}

	public void setUid(Integer uid) {
		this.uid = uid;
	}

	@Column(name = "friend_id", nullable = false)
	public Integer getFriendId() {
		return this.friendId;
	}

	public void setFriendId(Integer friendId) {
		this.friendId = friendId;
	}

	@Column(name = "group_name", length = 100)
	public String getGroupName() {
		return this.groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	@Column(name = "friend_date")
	public Integer getFriendDate() {
		return this.friendDate;
	}

	public void setFriendDate(Integer friendDate) {
		this.friendDate = friendDate;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof FriendListId))
			return false;
		FriendListId castOther = (FriendListId) other;

		return ((this.getUid() == castOther.getUid()) || (this.getUid() != null
				&& castOther.getUid() != null && this.getUid().equals(
				castOther.getUid())))
				&& ((this.getFriendId() == castOther.getFriendId()) || (this
						.getFriendId() != null
						&& castOther.getFriendId() != null && this
						.getFriendId().equals(castOther.getFriendId())))
				&& ((this.getGroupName() == castOther.getGroupName()) || (this
						.getGroupName() != null
						&& castOther.getGroupName() != null && this
						.getGroupName().equals(castOther.getGroupName())))
				&& ((this.getFriendDate() == castOther.getFriendDate()) || (this
						.getFriendDate() != null
						&& castOther.getFriendDate() != null && this
						.getFriendDate().equals(castOther.getFriendDate())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getUid() == null ? 0 : this.getUid().hashCode());
		result = 37 * result
				+ (getFriendId() == null ? 0 : this.getFriendId().hashCode());
		result = 37 * result
				+ (getGroupName() == null ? 0 : this.getGroupName().hashCode());
		result = 37
				* result
				+ (getFriendDate() == null ? 0 : this.getFriendDate()
						.hashCode());
		return result;
	}

}